package structure;

import node.AVLNode;
import node.Insertable;

/**
 *
 * @author Vojta
 */
public class AVLTree extends BinaryTree {
    
    @Override
    public boolean add(Insertable i) {
        AVLNode n = (AVLNode) i;
        if (root == null) {
            root = n;
            return true;
        }
        boolean isInserted = root.addChild(n);
        root = findRoot();
        return isInserted;
    }
}
